package first.niuke.simple;

import java.util.Stack;

/**
 * @ClassName NC76
 * @description:
 * @author: 荣燊
 * @create: 2021-04-07 10:17
 **/

//用两个栈实现队列
public class NC76 {
    Stack<Integer> stack1 = new Stack<Integer>();
    Stack<Integer> stack2 = new Stack<Integer>();

    public void push(int node) {
        stack1.push(node);
    }

    public int pop() {
        while(!stack1.isEmpty()) {
            stack2.push(stack1.pop());
        }
        return stack2.pop();
    }
}
